package org.aeon.server.handler.outbound;

import io.netty.channel.ChannelHandler;
import io.netty.channel.ChannelHandlerContext;
import io.netty.channel.ChannelOutboundHandlerAdapter;
import io.netty.channel.ChannelPromise;
import lombok.extern.slf4j.Slf4j;
import org.aeon.message.response.ResponseMessage;

/**
 * @author: MissingAeon
 * @date: 2024/3/4 10:59
 * @description:
 */
@Slf4j
@ChannelHandler.Sharable
public class ResponseMessageHandler extends ChannelOutboundHandlerAdapter {
    @Override
    public void write(ChannelHandlerContext ctx, Object msg, ChannelPromise promise) throws Exception {
        if (msg instanceof ResponseMessage message) {
            log.debug(message.getReason());
        }
        super.write(ctx, msg, promise);
    }
}
